package my.li.zhcsrenthousefront.controller;

import Vo.House;
import Vo.PropertyFee;
import land.RentHouseInterface;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import page.PageBean;
import util.JsonResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/fee")
public class PropertyFeeController {

    private RentHouseInterface feiginInterface;


    @RequestMapping("/")
    public String frist(HttpSession session){
        System.out.println("===========================================");
        session.setAttribute("propertyFees",new ArrayList<PropertyFee>());
        session.setAttribute("pagebean",new PageBean());
        return "propertyfee_manager";
    }

    @RequestMapping("/getAll")
    public String getAllMes(PageBean pageBean, HttpServletRequest request){
        System.out.println("======================= 进行分页查询");
        HttpSession session = request.getSession();
        session.setAttribute("pagebean",pageBean);

        List<PropertyFee> propertyFees = new ArrayList<>();
        session.setAttribute("propertyFees",propertyFees);
        return "propertyfee_manager";
    }

    @RequestMapping("/getById")
    @ResponseBody
    public JsonResult queryById(PropertyFee propertyFee){
//        util.JsonResult jsonResult = new util.JsonResult();
        System.out.println("queryByIdPropertyFee :  "+propertyFee);
        return JsonResult.successWithoutData();
    }


    @RequestMapping("/add")
    @ResponseBody
    public JsonResult addLand(PropertyFee propertyFee){

        System.out.println("addPropertyFee : "+propertyFee);
        return JsonResult.successWithoutData();
    }

    @RequestMapping("propertyfee_add")
    public String getAdd(PropertyFee propertyFee){
        System.out.println(  " "+propertyFee );
        //查询
        return "propertyfee_add";
    }

    @RequestMapping("deleteById")
    @ResponseBody
    public JsonResult deleteByLandId(PropertyFee propertyFee){
        System.out.println("deletePropertyFee" + propertyFee);
        return JsonResult.successWithoutData();
    }

}
